Skip to content

Conversation

@lynnt20
Copy link
Contributor

@lynnt20 lynnt20 commented Dec 10, 2025

Description

Adds info from SimEnergyDeposits and light calorimetry into cafmaker.

SBND is currently keeping SimEnergyDeposits throughout the workflow. We can take better advantage of this information (truth level number of electrons, photons, and true energy deposits for true neutrino interactions) by adding it to the cafs in a new class called SRTrueDeposit. Default will be empty if no SimEnergyDeposits are available in the input files. Only adds 3 floats per neutrino interaction (obtained from length of MCTruth).

Accompanying PRs: SBNSoftware/sbndcode#878, SBNSoftware/sbnanaobj#181, SBNSoftware/sbnobj#158

  • Have you added a label? (bug/enhancement/physics etc.)
  • Have you assigned at least 1 reviewer?
  • Is this PR related to an open issue / project?
  • Does this PR affect CAF data format? If so, please assign a CAF maintainer as additional reviewer.
  • Does this PR require merging another PR in a different repository (such as sbnanobj/sbnobj etc.)? If so, please link it in the description.

@kjplows
Copy link
Contributor

kjplows commented Dec 14, 2025

@lynnt20 could you nominate reviewers please?

@kjplows kjplows moved this to Open pull requests in SBN software development Dec 14, 2025
@linyan-w linyan-w moved this to Expected for Later in SBND 2025 Fall Production Dec 15, 2025
@linyan-w linyan-w moved this from Expected for Later to Waiting on Reviewer in SBND 2025 Fall Production Jan 22, 2026
@henrylay97 henrylay97 self-requested a review January 29, 2026 16:53
@lynnt20
Copy link
Contributor Author

lynnt20 commented Jan 29, 2026

@PetrilloAtWork would you mind taking a look at this PR? It's the last of the light calorimetry stack of PRs 😃 Thank you advance!

sbncode v10_14_02_01 for larsoft v10_14_02_01
Copy link
Member

@henrylay97 henrylay97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really good. Couple of small queries before I approve :D

@leoaliaga
Copy link

@PetrilloAtWork: when you have a moment, could you review this PR?

@kjplows kjplows moved this from Todo to In Progress in PR archaeology Feb 11, 2026
Copy link
Member

@PetrilloAtWork PetrilloAtWork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR is generally ok.
I requested the removal of the intermediate vector of art pointers, which is a bad practice being propagated since ages that I am trying to extinguish.

In addition, there are version number changes that should be left to the release managers. I am not sure what is going on, since it appears a release branch was merged here, and then this PR is requested to be merged with develop. If this is really what is needed, the merge of the release should happen before this PR is merged. Maybe that's the plan and I don't know it.

Comment on lines +1452 to +1455
std::vector<art::Ptr<sim::SimEnergyDeposit>> seds;
if (sed_handle.isValid()){
art::fill_ptr_vector(seds, sed_handle);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to create a vector of art pointers in this code. I'll mark the changes later.

Suggested change
std::vector<art::Ptr<sim::SimEnergyDeposit>> seds;
if (sed_handle.isValid()){
art::fill_ptr_vector(seds, sed_handle);
}

Comment on lines +1664 to +1666
for (size_t n_dep=0; n_dep < seds.size(); n_dep++){
auto sed = seds[n_dep];
const auto trackID = sed->TrackID();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the vector of pointers:

Suggested change
for (size_t n_dep=0; n_dep < seds.size(); n_dep++){
auto sed = seds[n_dep];
const auto trackID = sed->TrackID();
for (sim::SimEnergyDeposit const& sed: *sed_handle){
const auto trackID = sed.TrackID();

The three dereference operators below should also be changed: sed->sed..

Comment on lines +1448 to +1450
// get sim energy deposits if they're there
::art::Handle<std::vector<sim::SimEnergyDeposit>> sed_handle;
GetByLabelStrict(evt, fParams.SimEnergyDepositLabel().encode(), sed_handle);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest that the reading of the data product be moved close to where it is used first ([CF-021]).

Comment on lines +2094 to +2097
const sbn::LightCalo *slcLightCalo = nullptr;
if (foLightCalo.isValid()) {
slcLightCalo = foLightCalo.at(0).get();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can compact this using the ternary operator:

Suggested change
const sbn::LightCalo *slcLightCalo = nullptr;
if (foLightCalo.isValid()) {
slcLightCalo = foLightCalo.at(0).get();
}
const sbn::LightCalo *slcLightCalo = foLightCalo.isValid()? foLightCalo.at(0).get(): nullptr;

genie_xsec v3_06_00 -
larcv2 v2_2_6 -
larsoft v10_14_02 -
larsoft v10_14_02_01 -
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this change from the PR (it can stay in your working area, if you need it). It is up to the release managers to update the dependencies.


find_package(cetmodules 3.20.00 REQUIRED)
project(sbncode VERSION 10.14.02 LANGUAGES CXX)
project(sbncode VERSION 10.14.02.01 LANGUAGES CXX)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, this is release manager task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In Progress
Status: Open pull requests
Status: Waiting on Reviewer

Development

Successfully merging this pull request may close these issues.

5 participants